Support Hash-Based Routing #4746
Merged
philippthun merged 45 commits intocloudfoundry:mainfrom Jan 16, 2026
Merged
Conversation
…ute_options_message
philippthun
reviewed
Jan 13, 2026
Member
philippthun
left a comment
There was a problem hiding this comment.
Most comments are minor things...
There is a file test-manifest-roundrobin.yml which seems to be some leftover.
I don't think we should modify spec/unit/messages/validators_spec.rb. I see that this was already done for the other route options, but from my point of view this file is more for generic validators and not for specific ones. The tests should be moved into a file route_options_message_spec.rb.
1 task
philippthun
approved these changes
Jan 16, 2026
ari-wg-gitbot
added a commit
to cloudfoundry/capi-release
that referenced
this pull request
Jan 16, 2026
Changes in cloud_controller_ng:
- Support Hash-Based Routing
PR: cloudfoundry/cloud_controller_ng#4746
Author: Clemens Hoffmann <clemens.hoffmann@sap.com>
hoffmaen
added a commit
to sap-contributions/cloud_controller_ng
that referenced
this pull request
Jan 16, 2026
* Add loadbalancing option hash, and hash_header/hash_balance. Add validations * Add basic options validation to manifest_routes_update_message * Add basic tests for manifest route updates * Simplify validations, improve error messages, adjust tests * Add validation for hash balance being a float * Have consistent validations in manifest_routes_updates_message and route_options_message * Minor refactoring * Add check for hash_balance value being 0 or >=1.1 * Transform hash_balance to string in the route model before saving * Validate the route merged with the route update from the message. * Attempt to forward errors in route_update validation to the client * Add route options changes to app event * Add new hash options to mnifest route * Add new hash options to route properties presenter * Move additional validation to route model * Move final options cleanup to route model * Proper error validation and forwarding * Forward proper error message on route updates * Add some logging to find the manifest issue * Add more logging * Logging in app_manifest_message * Test a few things * Test a few things pt 2 * Test a few things pt 3 * Test a few things pt 4 * Test a few things pt 5 * Test a few things pt 6 * Cleanup logging * Use symbolized_keys in route_update * WIP * Add more validations and tests * Add more tests for route_update * Add more tests * Some test fixes and cleanup * Use blank? instead of nil? for loadbalancing check * Fix rubocop issues * Fix rubocop spec issues * Refactor to resolve rubocop complexity findings * Remove test file * Move all route option message tests from validator spec to new spec file * Introduce stub config in validator spec to fix execution of standalone spec test * Fix typos and validation logic * Fix validation function name inconsistencies * Fix remaining issues found in review * revert change to validators spec
hoffmaen
added a commit
to sap-contributions/cloud_controller_ng
that referenced
this pull request
Jan 26, 2026
* Add loadbalancing option hash, and hash_header/hash_balance. Add validations * Add basic options validation to manifest_routes_update_message * Add basic tests for manifest route updates * Simplify validations, improve error messages, adjust tests * Add validation for hash balance being a float * Have consistent validations in manifest_routes_updates_message and route_options_message * Minor refactoring * Add check for hash_balance value being 0 or >=1.1 * Transform hash_balance to string in the route model before saving * Validate the route merged with the route update from the message. * Attempt to forward errors in route_update validation to the client * Add route options changes to app event * Add new hash options to mnifest route * Add new hash options to route properties presenter * Move additional validation to route model * Move final options cleanup to route model * Proper error validation and forwarding * Forward proper error message on route updates * Add some logging to find the manifest issue * Add more logging * Logging in app_manifest_message * Test a few things * Test a few things pt 2 * Test a few things pt 3 * Test a few things pt 4 * Test a few things pt 5 * Test a few things pt 6 * Cleanup logging * Use symbolized_keys in route_update * WIP * Add more validations and tests * Add more tests for route_update * Add more tests * Some test fixes and cleanup * Use blank? instead of nil? for loadbalancing check * Fix rubocop issues * Fix rubocop spec issues * Refactor to resolve rubocop complexity findings * Remove test file * Move all route option message tests from validator spec to new spec file * Introduce stub config in validator spec to fix execution of standalone spec test * Fix typos and validation logic * Fix validation function name inconsistencies * Fix remaining issues found in review * revert change to validators spec
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This Pull-Request replaces #4696.
This Pull-Request adds support for hash-based routing to Cloud Controller.
Summary:
The routes model is enhanced as follows:
hashis added as a validloadbalancingoptionhash_headeris added as a per-route option. The option is mandatory whenloadbalancing=hashhash_balanceis added as a per-route option. The option is optional whenloadbalancing=hashValidation of these options is added when creating and updating both via API and via manifest. All validations that do not need the context of a potentially existing route during an update, are executed in the message:
Further validations and cleanups are performed on the route model, as they need the context of existing routes:
hash, then Hash Header must be specifiedThe route options are still stored as a raw JSON string in the routes table.
Links:
Thanks for contributing to cloud_controller_ng. To speed up the process of reviewing your pull request please provide us with:
A short explanation of the proposed change:
An explanation of the use cases your change solves
Links to any other associated PRs
I have reviewed the contributing guide
I have viewed, signed, and submitted the Contributor License Agreement
I have made this pull request to the
mainbranchI have run all the unit tests using
bundle exec rakeI have run CF Acceptance Tests